import turtle

# 创建一个窗口和画笔
screen = turtle.Screen()
pen = turtle.Turtle()

# 设置背景颜色
screen.bgcolor("black")

# 彩虹颜色列表
colors = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']

# 设置画笔速度
pen.speed(10)
pen.penup()
pen.goto(0, -200)
pen.pendown()

# 绘制彩虹
for i in range(7):
    pen.color(colors[i])
    pen.circle(200 - i * 20)
    pen.penup()
    pen.goto(0, -200 + (i+1) * 20)
    pen.pendown()

# 点击关闭窗口
screen.exitonclick()